const {expressjwt} = require("express-jwt")

const jwtAuth = expressjwt({
    secret:"suibian",//加密的秘钥
    algorithms:["HS256"], //采用HS256加密算法
    credentialsRequired:true //不管有没有携带token都需要验证
}).unless({
    //设置白名单
    path:["/users/login","/users/reg","/users/list","/roles/findRoles",/\/type\/*/,/\/opera\/.*/,"/api/users/login","//users/login"]
})

module.exports = jwtAuth